﻿using ShiQuan.DataAccess;
using ShiQuan.DataMySql;
using ShiQuan.DataServer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ShiQuan.DataRepository
{
    /// <summary>
    /// 数据工厂
    /// </summary>
    public class DataFactory
    {
        /// <summary>
        /// 获取数据操作对象
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static IDatabase GetDataBase(string name)
        {
            //switch (name)
            //{
            //    case "MySql":
            //        {
            //            return new MySqlDataBase();
            //        }
            //    case "SqlServer":
            //    default:
            //        {
            //            return new SqlDataBase();
            //        }
            //}
            return ShiQuan.Unity.UnityHelper.Instance.GetResolve<IDatabase>(name);
        }
    }
}
